<template>
	<uni-nav-bar title="订单确认页" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar></uni-nav-bar>
	<Process :state="'2'"></Process>
	<view class="package" style="padding:20rpx 0px">
		<view v-for="(item,index) in orderList" :key='item.id'>
			<view class="packageLsit">
				<image src="../../static/groupBenefits/shop.png" mode=""></image>
				<text>{{item.store_name}}</text>
			</view>
			<ShopList :type="'subsidy'" :shoppAll="item" :jump="'1'"></ShopList>
		</view>
		<Shoppay :payFor="orderPrice" :state="'groupDetail'"></Shoppay>
	</view>
	<ShopBot
	 :share="''" 
	 :state="'sureOrder'"
	 :money="orderPrice.money" 
	 :totalMoney="orderPrice.total_money"
	 :yhPrice="orderPrice.yh_money"
	 :bao_id="orderID"
	 :empty="true"
	 :addNums="0"
	 :text="'应付'"
	 :sures="true">
	</ShopBot>
</template>

<script setup lang="ts">
	import { navBack} from '@/utils/navigator';
	import { errorToast, successToast } from '@/utils/prompt';
	import { isH5 } from '@/utils/platform';
	import Process from '@c/groupBenefits/process.vue';
	import ShopBot from '@c/groupBenefits/DetailBot.vue';
	import ShopList from '@c/groupBenefits/shopGrid.vue';
	import Shoppay from '@c/groupBenefits/pay.vue';
	import { onLoad } from '@dcloudio/uni-app';
	import {toPublish} from '@mqtt';
	import {orderTeam} from '@/gql/group';
	import { ref,Ref } from 'vue';
	import { getDriverID } from '@/stores/driverID';
	const orderID=ref('')
	const orderPrice: Ref < any > = ref({});
	const orderList=ref([])
	
	onLoad((pearm)=>{
		orderID.value=pearm.id
		init()
		uni.removeStorageSync('detail')
		uni.removeStorageSync('Texmtitle')
	})
	function init(){
		const payload = {
		 query: orderTeam,
			variables: {
				id:Number(orderID.value)
			},
		};
		toPublish('ql/store/getTeamOrderGoods', payload, (obj: any) => {
			const {bao_team_info} = obj.data;
			orderPrice.value=bao_team_info
			orderList.value=bao_team_info.goods_list
		});
	}
</script>

<style scoped lang="less">
	.packageLsit{
		width: 100%;
		display:flex;
		align-items: center;
		padding:0px 20rpx;
		box-sizing: border-box;
		image{
			width: 50rpx;
			height: 50rpx;
		}
		text{
			font-size: 30rpx;
			font-weight: 400;
			color: #181818;
			margin: 0px 10rpx;
		}
	}
</style>